import request from '@/utils/request'

export function fetchList(params) {
  return request({
    url: '/flashSession/list',
    method: 'get',
    params: params
  })
}

export function fetchSelectList(params) {
  return request({
    url: '/flashSession/selectList',
    method: 'get',
    params: params
  })
}

export function updateStatus(id, params) {
  return request({
    url: '/flashSession/update/status/' + id,
    method: 'post',
    params: params
  })
}

export function deleteSession(id) {
  return request({
    url: '/flashSession/delete/' + id,
    method: 'post'
  })
}

export function createSession(data) {
  return request({
    url: '/flashSession/create',
    method: 'post',
    data: data
  })
}

export function updateSession(id, data) {
  return request({
    url: '/flashSession/update/' + id,
    method: 'post',
    data: data
  })
}
// 获取全部拼团场次
export function assembleList(params) {
  return request({
    url: '/groupBuyingSession/selectList', 
    method: 'get',
    params: params
  })
}
// 添加拼团时间列表
export function assemblecreateSession(data) {
  return request({
    url: '/groupBuyingSession/create',
    method: 'post',
    data: data
  })
}
// 修改拼团启用状态
export function assembleupdateStatus(id, params) {
  return request({
    url: '/groupBuyingSession/update/status/' + id,
    method: 'post',
    params: params
  })
}
// 删除拼团场次
export function assembledeleteSession(id) {
  return request({
    url: '/groupBuyingSession/delete/' + id,
    method: 'post'
  })
}
// 修改场次
export function assembleupdateSession(id, data) {
  return request({
    url: '/groupBuyingSession/update/' + id,
    method: 'post',
    data: data
  })
}

// 获取列表楼层信息
export function floorList(params) {
  return request({
    url: '/mallHome/getFloorsList',
    method: 'get',
    params: params
  })
}

// 获取全部拼团场次
export function assembleListgetList(params) {
  return request({
    url: '/groupBuyingSession/getList', 
    method: 'get',
    params: params
  })
}